#/bin/sh
project_name=$1

script_folder=$(dirname $(readlink -f "$0"))
toplevel_dir=`dirname ${script_folder}`
old_project_name=$(cat ${toplevel_dir}/CMakeLists.txt | grep "project(" | tr "()" " " | cut -d' ' -f2)
files=$(find ${toplevel_dir} -name "CMakeLists*")
sed -i -e s/${old_project_name}/${project_name}/ ${files} ${toplevel_dir}/.vscode/launch.json
